import request from '@/utils/request'
// 登录接口
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

// 获取-用户基本资料
// GET/sys/profile
export function getProfile() {
  return request({
    url: '/sys/profile',
    method: 'get'

  })
}
// 修改用户密码接口
export const putUserPass = data => {
  return request({
    method: 'PUT',
    url: '/sys/user/updatePass',
    data
  })
}
// 获取部门列表
export const getDepartments = () => {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}
// 获取部门负责人列表
export const getUserSimple = () => {
  return request({
    method: 'GET',
    url: '/sys/user/simple'
  })
}

// 新增部门
export const postDepartment = data => {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}
// 获取部门详情
export const getDepartmentById = id => {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}
// 删除部门
export const deleteDepartmentById = id => {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
// 修改部门
export const putDepartment = (data) => {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
